window.makeNamespace(window, "Rainier.UI.V2");
Rainier.UI.V2.CustomTextFigure = draw2d.shape.basic.Label.extend({
  NAME: "Rainier.UI.V2.CustomTextFigure",

  init: function (modelProperties) {
    this._super({
      text: modelProperties.modelProperty.text,
      fontColor: modelProperties.uiProperty.color,
      fontSize: modelProperties.uiProperty.fontSize,
      width: 90,
      stroke: 0,
      bold: modelProperties.uiProperty.bold,
    });
    // this.installEditor(new draw2d.ui.LabelInplaceEditor());
  },

  /**
   * @名称   repaint
   * @功能   绘制图元
   * @author 杨顺强
   * @data   2017-09-21
   * @param  {[type]}   attributes [description]
   * @return {[type]}              [description]
   */
  repaint: function (attributes) {
    this._super(attributes);
  },

  /**
   * 函数名称：Rainier.UI.V2.TextFigure.setSymbolLabelFigure<br>
   * 函数功能：设置Label<br>
   * 参数输入：<br>
   * property:属性对象<br>
   * sLocator:定位器构造函数<br>
   * x:Number<br>
   * y:Number<br>
   * 函数返回：无<br>
   * 异常信息：无<br>
   */
  setSymbolLabelFigure: function (property, sLocator, x, y) {
    var locator = null;
    if (!sLocator || sLocator === "default") {
      locator = new Rainier.UI.V2.XYAbsFigureLocator(x, y);
    } else {
      locator = eval("new " + sLocator + "();");
      locator.offsetX = x;
      locator.offsetY = y;
    }
    property.stroke = 0;
    this.symbolLabelFigure = new Rainier.UI.V2.DeviceSymbolLabelFigure(property, locator);
    this.add(this.symbolLabelFigure, locator);
  },

  /**
   * 函数名称：Rainier.UI.V2.TextFigure.showLabel<br>
   * 函数功能：显示标签<br>
   * 函数返回：无<br>
   * 异常信息：无<br>
   */
  showLabel: function () {
    this.labelVisible = false;
    if (this.symbolLabelFigure) {
      this.symbolLabelFigure.setVisible(true);
    }
  },

  /**
   * 函数名称：Rainier.UI.V2.DeviceBoxFigure.unshowLabel<br>
   * 函数功能：隐藏标签<br>
   * 函数返回：无<br>
   * 异常信息：无<br>
   */
  unshowLabel: function () {
    this.labelVisible = false;
    if (this.symbolLabelFigure) {
      this.symbolLabelFigure.setVisible(false);
    }
  },
});
